/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author luksCastro
 */
@Entity
@Table(name = "obrasocial")
@NamedQueries({
    @NamedQuery(name = "Obrasocial.findAll", query = "SELECT o FROM Obrasocial o")})
public class Obrasocial implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idObraSocial")
    private Integer idObraSocial;
    @Column(name = "nombreObraSocial")
    private String nombreObraSocial;
    @OneToMany(mappedBy = "obrasocialidObraSocial")
    private List<Empleado> empleadoList;

    public Obrasocial() {
    }

    public Obrasocial(Integer idObraSocial) {
        this.idObraSocial = idObraSocial;
    }

    public Integer getIdObraSocial() {
        return idObraSocial;
    }

    public void setIdObraSocial(Integer idObraSocial) {
        this.idObraSocial = idObraSocial;
    }

    public String getNombreObraSocial() {
        return nombreObraSocial;
    }

    public void setNombreObraSocial(String nombreObraSocial) {
        this.nombreObraSocial = nombreObraSocial;
    }

    public List<Empleado> getEmpleadoList() {
        return empleadoList;
    }

    public void setEmpleadoList(List<Empleado> empleadoList) {
        this.empleadoList = empleadoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idObraSocial != null ? idObraSocial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Obrasocial)) {
            return false;
        }
        Obrasocial other = (Obrasocial) object;
        if ((this.idObraSocial == null && other.idObraSocial != null) || (this.idObraSocial != null && !this.idObraSocial.equals(other.idObraSocial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Obrasocial[ idObraSocial=" + idObraSocial + " ]";
    }
    
}
